var mongoose = require("mongoose");
// 定义一个新闻结构
var newsSchema = new mongoose.Schema({
  title: {
    type: String,
    require: true,
    trim: true
  },
  content: {
    type: String,
    trim: true
  },
  pubData: {
    type: Date,
    require: true,
    default: Date.now
  },
  channel: {
    type: String,
    require: true
  },
  link: {
    type: String,
    require: true
  }
});

module.exports = mongoose.model("News", newsSchema);
